package com.wyl.pmd.rule.design;

public class SimplifiedTernary {

	private boolean condition = true;
	
	public boolean test() {
        //return condition ? true : something(); // bad 
		return condition || something(); //good
    }

    public void test2() {
        boolean value = condition ? false : something(); // bad
        value = !condition && something(); // good
    }

    public boolean test3() {
        //return condition ? something() : true; // bad
    	return !condition || something(); // good
    }

    public void test4() {
        boolean otherValue = condition ? something() : false; // bad
        otherValue = condition && something(); // good
    }
    
    private boolean something() {
    	return false;
    }
	
}
